package com.dyna.domain.form.event;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@ApiModel("福袋发布表单数据")
public class LuckyBagEventForm {

    @ApiModelProperty("福袋标题")
    @NotBlank(message = "福袋标题不能为空")
    private String title;

    @ApiModelProperty("福袋类别")
    @NotNull(message = "福袋类别不能为空")
    private Integer category;

    @ApiModelProperty("单抽价格")
    @NotNull(message = "单抽价格不能为空")
    private BigDecimal price;

    @ApiModelProperty("总库存")
    @NotNull(message = "发布商品不能为空")
    private BigDecimal totalStock;

    @ApiModelProperty("剩余库存")
    private BigDecimal remainingStock;

    @ApiModelProperty(value = "公布类型", notes = "1:售后立开，2售完全开")
    @NotNull(message = "公布类型不能为空")
    private Integer type;

    @ApiModelProperty(value = "概率配置", notes = "含保底规则")
    private String probabilityConfig;

    @ApiModelProperty("开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty("结束时间")
    private LocalDateTime endTime;

    @ApiModelProperty("福袋赠品")
    @NotEmpty(message = "福袋赠品不能为空")
    private List<LuckyBagEventItem> luckyBagEventItemList;

    @Data
    public static class LuckyBagEventItem {

        @ApiModelProperty("物品id")
        private Long itemId;

        @ApiModelProperty("物品数量")
        private Integer count;

    }

}
